/*
 * IShoppingCartHelperModel.java
 * business
 *
 * Created by ChenTao on 2016/11/8.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.data.model;

import com.yidiandao.business.data.bean.Goods;
import com.yidiandao.business.data.bean.Shop;

/**
 * 商品列表操作加入购物车、立即购买的Model
 */
public interface IShoppingCartHelperModel {

    /**
     * 获取对应商品的购物车数据
     */
    void getCatGoodsInfo(String goodsId, String tag, OnGetGoodsInfoListener listener);

    /**
     * 添加到购物车
     *
     * @param goodsId 商品id
     * @param count   商品数量
     */
    void addToCart(String tag, String goodsId, int count, OnAddToShoppingCartListener listener);

    /**
     * 立即购买
     *
     * @param goodsId 商品id
     * @param number  商品数量
     */
    void buyNow(String tag, String goodsId, int number, OnBuyNowListener listener);

    interface OnGetGoodsInfoListener {

        void onSuccess(Goods goods);

        void onFailed();
    }

    interface OnAddToShoppingCartListener {

        void onSuccess(Shop shop, Goods goods);

    }

    interface OnBuyNowListener {

        void onSuccess();
    }
}
